package com.pervasa.demo.kitsample.impl;

import java.sql.Timestamp;

enum QueryOpType
{
    OPTYPE_INSERT,
    OPTYPE_GET_COUNT,
    OPTYPE_GET_INT,
    OPTYPE_GET_DOUBLE,
    OPTYPE_INSERT_RESULT
}

public class QueryParam {

    private QueryOpType opType;
    private String sql = null;
    private String sensorID = null;
    private String sensorValue;
    private boolean isPush;
    private Timestamp timestamp;
    
    private int allEvent;
    private int pullEvent;
    private int readEvent;

    public void setQueryOpType(QueryOpType queryType)
    {
        opType = queryType;
    }

    public QueryOpType getQueryOpType()
    {
        return opType;
    }

    public void setSQLString(String sqlStr)
    {
        sql = sqlStr;
    }

    public String getSQLString()
    {
        return sql;
    }

    public void setSensorID(String id)
    {
        sensorID = id;
    }

    public String getSensorID()
    {
        return sensorID;
    }

    public void setSensorValue(String value)
    {
        sensorValue = value;
    }

    public String getSensorValue()
    {
        return sensorValue;
    }

    public void setPush(boolean isPush)
    {
        this.isPush = isPush;
    }

    public boolean isPush()
    {
        return isPush;
    }

    public void setTimeStamp(Timestamp ts)
    {
        timestamp = new Timestamp(ts.getTime());
    }

    public Timestamp getTimeStamp()
    {
        return timestamp;
    }

    public void setShortcutResult(int allValue, int pullValue, int readValue)
    {
        allEvent = allValue;
        pullEvent = pullValue;
        readEvent = readValue; 
    }

    public int getAllEventCount()
    {
        return allEvent;
    }

    public int getPullEventCount()
    {
        return pullEvent;
    }

    public int getReadEventCount()
    {
        return readEvent;
    }
}
